﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Garden.Helper;
using Garden.Model;
using Kaixin.BLL;

namespace Garden.Func
{
    class SowMan:WorkMan
    {
        public SowMan()
        {
            WhichPage = "farmseed";
        }
        protected override bool WorkCondition(Farmland land)
        {

            if( land.Status == 1 && land.UID == "0" && land.Seed.ID == string.Empty && !land.IsLoveFarm)
            {
                land.Seed.ID = GardenConfig.SowID.ToString();
                return true;
            }
            return false;
        }

        protected override void WorkSummary(Farmland land, LogWrite log, string data)
        {
            string val = RegexHelper.GetFirstVal(data, RegexHelper.RetReg);
            log(string.Format("{0}号地：播种{1}", land.FarmNum, val));
        }
    }
}
